<template>
	<view class="body">
		<xk-header title="票单取消"></xk-header>
		<view class="u-demo-block__content list" style="background-color: #FFFFFF;">
			<u-row customStyle="margin-bottom: 10px">
				<u-col span="8">
					<view class="demo-layout bg-purple-light word">取消原因</view>
				</u-col>
			</u-row>
			<view style="margin-bottom: 30px;">
				<u--textarea v-model="cancelData.cancel_content" placeholder="请填写原因" class = "info" height="200"></u--textarea>
			</view>
			<!-- <textarea v-model="formData.invoic_info" type="text" placeholder="---在此输入相关信息---" placeholder-class="placeholder" s/> -->
		</view>

		<view class="common-bottom-view">
		 	<view @click="createFix" class="common-btn">确认取消票单</view>
		 </view>
	</view>
</template>

<script>
export default{
	data(){
		return{
			// date:date(new Date(),'yyyy-mm-dd ')
			cancelData:{
				pi_invoic_id:'',
				cancel_content:'',
				cancel_date:'',
				isSubmit:''
			}
		}
	},
	onLoad(options) {
		this.cancelData.pi_invoic_id = options.invoicId
	},
	methods:{
		createFix(){
			this.cancelData.cancel_date = this.$util.getNowDate()
			this.cancelData.isSubmit = false
			this.$util.confirm({
				content: "确定取消开票申请？",
				confirmText: "确定"
			}).then(isConfirm => {
				if (isConfirm) {
					console.log("结果：",this.cancelData)
					this.$util.post({
						url: "app/piInvoic/cancel",
						data: this.cancelData,
					}).then(res => {
						uni.redirectTo({
							url: '/pagesB/open-ticket/ticket-apply-list'
						})
					})

				}
			})
			console.log("取消成功")
		}
	}
}
</script>

<style lang="scss" scoped>
@import '@/common/from.scss';

.word{
	font-size: 20px;
	margin: 10px;
}

</style>
